const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  entry: {
    'main': './index.ts',
    'promiseA+':  './src/promiseA+/index.ts'
  },
  mode: 'development',
  module: {
    rules: [
      {
        test: /\.(ts)$/,
        use: 'awesome-typescript-loader',
        exclude: /node_modules/
      }
    ]
  },
  plugins: [
    new CleanWebpackPlugin(),
    new HtmlWebpackPlugin({
      template: './public/index.html',
      chunks: ['main', 'promiseA+']
    })
  ],
  devServer: {
    overlay: {
      errors: true,
    },
    stats: 'errors-only',
    compress: true,
    port: 8686,
    open: true,
  }
}